import React,{useState} from 'react'
export default function Index() {
  const [count,setCount] = useState(0)
  function add (){
    setCount(res=>res+1)
  }
  return (
    <>
      <h1>这里是首页</h1>
      <h4>求和的值为:{count}</h4>
      {/* <button onClick={() => setCount(2)}>+1</button> */}
      <button onClick={add}>+1</button>
    </>
  )
}
